home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
amigadoslibrary
/
fputc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-10
|
783b
|
43 lines
/* FPutC.c V1.1 93-03-03 */
/* ROM library: "dos.library/FPutC", (V36+) */
/* Copyright 1993, Anders Bjerin, Amiga C Club */
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <stdio.h>
#include <stdlib.h>
#define CHAR_J 74
UBYTE *version = "$VER: FPutC 1.1";
int main( int argc, char *argv[] );
int main( int argc, char *argv[] )
{
BPTR my_file;
int error_code;
/* Open a new file: */
my_file = Open( "RAM:Important.dat", MODE_NEWFILE );
if( !my_file )
exit( 20 );
/* Store one character: */
error_code = FPutC( my_file, CHAR_J );
/* OK? */
if( error_code == -1 )
printf( "Could not save the character!\n" );
else
printf( "The character was successsfully saved!\n" );
Close( my_file );
exit( 0 );
}